/**
  ******************************************************************************
  * @file    User/LL/user.h
  * @author  TOPSYS Application Team
  * @version V1.0.0
  * @date    02-11-2018
  * @brief   Main program body header file
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2018 TOPSYS</center></h2>
  *
  *
  */ 
  
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USER_H__
#define __USER_H__

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "include.h"

/** @addtogroup Template_Project
  * @{
  */

/** @addtogroup USER
  * @{
  */ 

     
/** @defgroup USER_Exported_Constants
  * @{
  */

#define USE_WHITE_LIGHT                 1



#define DISP0         0xfa0
#define DISP1         0x0a0
#define DISP2         0xec0
#define DISP3         0x6e0
#define DISP4         0x1e0
#define DISP5         0x760
#define DISP6         0xf60
#define DISP7         0x2a0
#define DISP8         0xfe0
#define DISP9         0x7e0


/**
  * @}
  */

extern int counter;
/** @defgroup USER_Exported_Functions
  * @{
  */

/**
  * @brief  Uart initialization function
  * @param  None
  * @retval None
  */
void uart_init(void);

/**
  * @brief  TK initialization function
  * @param  None
  * @retval None
  */
int tk_init(void);

/**
  * @brief  TK data handle function
  * @param  None
  * @retval None
  */
void tk_handle(void);

/**
  * @brief  led light off all code function
  * @param  p_led_base_adr: pointer of led base address
  * @retval None
  */
void led_light_off_all(u32 *p_led_base_adr);

void Vm_Exec(void);

/**
  * @brief  COM CODE setting function
  * @param  p_led_base_adr: pointer of led base address
  * @param  com_num: com number
  * @param  com_code: com code
  * @retval None
  */
void led_com_code(u32 *p_led_base_adr, u32 com_num, u32 com_code);

/**
  * @brief  buz_pwm init  
  * @param  None
  * @retval None
  */
void buz_pwm_init(void);

/**
  * @brief  buz_start config  
  * @param  None
  * @retval None
  */
void buz_start(void);

/**
  * @brief  if buz stop check according to buz open timeout  
  * @param  None
  * @retval None
  */
void buz_chk_stop(void);


/**
  * @brief  led flash
  * @param  None
  * @note   None
  * @retval None
  */
void led_flash(void);

/** 
  * @brief  touch key bit map statue 
  * @param  p_tk: The structure pointer of the TK is selected
  * @retval key map state
  */
u32 tk_key_map_state_super_get(TK_TypeDef *p_tk);



/**
  * @}
  */ 

#ifdef __cplusplus
}
#endif

#endif //__USER_H__

/**
  * @}
  */

/**
  * @}
  */

/*************************** (C) COPYRIGHT 2018 TOPSYS ***** END OF FILE *****/
